package com.photographysharing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.photographysharing.dto.FollowDTO;
import com.photographysharing.entity.Follows;
import com.photographysharing.response.DatasResponse;
import com.photographysharing.service.FollowsService;
import com.photographysharing.mapper.FollowsMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Z
* @description 针对表【follows】的数据库操作Service实现
* @createDate 2024-05-14 21:15:11
*/
@Service
public class FollowsServiceImpl extends ServiceImpl<FollowsMapper, Follows>
    implements FollowsService{

    private  FollowsMapper followsMapper;

    public FollowsServiceImpl(FollowsMapper followsMapper) {
        this.followsMapper = followsMapper;
    }

    @Override
    public DatasResponse<FollowDTO> getFollows(String userId) {
        List<FollowDTO> datas = followsMapper.getFollows(userId);
        return  new DatasResponse<>(datas.size(),datas);
    }
}




